Skip to content

Add SilverStripe 6 compatibility#40

Merged
jsirish merged 5 commits intomasterfrom
feature/ss6
Oct 17, 2025
Merged

Add SilverStripe 6 compatibility#40
jsirish merged 5 commits intomasterfrom
feature/ss6

Conversation

@jsirish
Copy link
Copy Markdown
Member

@jsirish jsirish commented Oct 17, 2025

Overview

This PR adds SilverStripe 6 compatibility to the silverstripe-elemental-baseobject module.

Changes

Dependency Updates

  • dnadesign/silverstripe-elemental: ^5^6.0
  • silverstripe/linkfield: ^4.0^5.0
  • silvershop/silverstripe-hasonefield: ^4^5.0
  • unclecheese/display-logic: ^3^4.0
  • silverstripe/recipe-testing: ^3^4.0

Code Quality Improvements

  • Added PHPStan static analysis configuration at level 4
  • Added cambis/silverstan for SilverStripe-specific PHPStan rules
  • Added phpstan/extension-installer to automatically load PHPStan extensions
  • Added PHPStan ignore comments for methods available at runtime:
    • setFolderName() on UploadField
    • setRows() on TextareaField
    • canArchive() on versioned SiteTree

Testing

✅ All tests passing:

  • PHPUnit: 6 tests, 16 assertions
  • PHPCS: No violations
  • PHPStan: No errors (level 4)

Compatibility

  • SilverStripe: 6.x
  • PHP: 8.1+

- Upgrade dependencies to SilverStripe 6 compatible versions
  - dnadesign/silverstripe-elemental ^6.0
  - silverstripe/linkfield ^5.0
  - silvershop/silverstripe-hasonefield ^5.0
  - unclecheese/display-logic ^4.0
- Add PHPStan static analysis with level 4
- Add PHPStan ignore comments for runtime-available methods
- Update dev dependencies for testing and code quality
Copilot AI review requested due to automatic review settings October 17, 2025 16:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades the silverstripe-elemental-baseobject module to be compatible with SilverStripe 6, updating all major dependencies to their latest versions and introducing PHPStan static analysis at level 4.

  • Updated core dependencies from SilverStripe 5 to 6 compatible versions
  • Added PHPStan static analysis tooling with SilverStripe-specific rules
  • Added PHPStan ignore comments for runtime-available methods that lack proper type definitions

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
composer.json Updated dependencies to SilverStripe 6 compatible versions and added PHPStan tooling
phpstan.neon Added PHPStan configuration file with level 4 analysis
src/Model/BaseElementObject.php Refactored method chaining and added PHPStan ignore comments for runtime methods

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@jsirish jsirish requested a review from Copilot October 17, 2025 16:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@jsirish jsirish requested a review from Copilot October 17, 2025 16:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

README.md Outdated
Comment on lines +14 to +16
* SilverStripe ^6.0
* dnadesign/silverstripe-elemental ^6.0
* silverstripe/linkfield ^5.0
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The requirements list uses inconsistent formatting for version constraints. Line 14 uses ^6.0 while lines 15-16 omit the caret symbol. For consistency, either include ^ for all entries or use a consistent format throughout.

Copilot uses AI. Check for mistakes.
@jsirish jsirish requested a review from Copilot October 17, 2025 16:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

composer.json Outdated
"silverstripe/frameworktest": "^1"
"cambis/silverstan": "^2.1",
"silverstripe/recipe-testing": "^4.0",
"squizlabs/php_codesniffer": "^3.7",
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The squizlabs/php_codesniffer package appears to be newly added but is not mentioned in the PR description. If this is intentionally added for code quality checks, consider documenting it in the PR description alongside PHPStan. If it's already present in the codebase, this comment can be disregarded.

Copilot uses AI. Check for mistakes.
@jsirish jsirish merged commit 6364b9b into master Oct 17, 2025
16 checks passed
@jsirish jsirish deleted the feature/ss6 branch October 17, 2025 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants